"use strict";
// 首页数据
import Reflux from "reflux";

import lscache from "lscache";

import { StoreMixin } from "./common.js";
import { getISODate } from "../common/datehelper.js";


var IndexActions = Reflux.createActions(["fetchData", "saveState"]);

var IndexStore = Reflux.createStore({
    // 获取交易页面所有数据
    mixins: [ StoreMixin ],
    listenables: [IndexActions],
    cacheKey: 'stores.indexstore',
    params: {
        sign:'ABB89E0ADAE0B1B16D6E06DBE95ACF1E', 
        dimdate:'DAY', 
        // startdate: '20140930',//getISODate(new Date()).replace(/\-/g, ''), 
        startdate: getISODate(new Date()).replace(/\-/g, ''), 
        // enddate: '20140930',//getISODate(new Date()).replace(/\-/g, ''),
        enddate: getISODate(new Date()).replace(/\-/g, ''),
        comparetype: 'DOD',
        needback: 1,
        // ds_comr_volumes_startdate: '20140915'
    },
    apis: {
        ds_customer_t0: {params: ['sign', 'dimdate',]},

        ds_trade_t1_hb: {name:'ds_trade_t1', params: ['sign', 'dimdate', 'startdate', 'enddate', 'comparetype', 'needback']},
        ds_customer_t1_hb: {name:'ds_customer_t1', params: ['sign', 'dimdate', 'startdate', 'enddate', 'comparetype', 'needback']},
    }
})


export { IndexActions, IndexStore };